package cn.wsalix.weixin.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import cn.anlaser.entity.CommonEntity;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "WX_ARTICLE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class WxArticle extends CommonEntity{

    /**
	 * 
	 */
	private static final long serialVersionUID = 2920875182998846560L;
	private String title;
    private String description;
    private String picUrl;
    private String url;
    @ManyToOne(cascade = CascadeType.MERGE, optional = true, fetch = FetchType.LAZY)
	@JoinColumn(foreignKey = @ForeignKey(name = "FK_ARTICLE_NEWSMSG_ID"), name = "NEWSMSG_ID")
	private NewsMsg newsMsg;// 手机图片
    public WxArticle() {

    }

    public WxArticle(String title) {
        this.title = title;
    }

    public WxArticle(String title, String url) {
        this.title = title;
        this.url = url;
    }

    public WxArticle(String title, String description, String picUrl, String url) {
        this.title = title;
        this.description = description;
        this.picUrl = picUrl;
        this.url = url;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

}
